import Vue from "vue"
import Router from "vue-router"
import NotFoundComponent from "@/view/404" //404
import login from "@/view/login/login" //登陆
import main from "@/view/main" //跑腿菜单

import indexIndex from '@/view/index/index'                    //跑腿首页
import orderIndex from  '@/view/order/index'                    //跑腿订单
import bessetPirce from '@/view/besset/price'                //跑腿业务设置
import bessettime from '@/view/besset/time'
import activityAdd from '@/view/activity/add'                //活动管理
import activitySet from '@/view/activity/set'
Vue.use(Router)
export default new Router({
    mode: 'history',
    base: __dirname,
    routes: [
        {path: '*', component: NotFoundComponent},                                          //404
        {path: '/login', name: login, component: login},                                    //重定向到首页
        {path: '/', redirect: '/main/index/index'},                                         //重定向到首页
        {path: '/main',component: main, redirect: '/main/index/index',children: [         //redirect重定向默认第一个列表
            //首页
            {path: '/main/index/index', component: indexIndex},
            //跑腿订单
            {path: '/main/order/index', component: orderIndex},
            //跑腿业务
            {path: '/main/besset/pirce', component: bessetPirce},
            {path: '/main/besset/time', component: bessettime},
            //活动管理
            {path: '/main/activity/add', component: activityAdd},
            {path: '/main/activity/set', component:activitySet},

        ]
        }
    ]
})
